Welcome to the solution for coding exercise 7 and of import pen us and also the listings clean CSP fire
and then we thought the listings that are framed by the IPO year column from old to new and then we
reset the index and create a new Range Index.
Starting from zero.
So let's have a look here so here we have our listings sorted by the IPO year starting with the listings
before nineteen hundred seventy and before we can create plots we have to import them at plot lip as
appeared here and as a matter of taste.
We use the Seabourn style by passing Seabourn to the method style that use and now the very first task
is easier to create.
The airline plot below and obviously this this airline plot organized as subplots and on the left hand
side we can see here that the y axis has different scales.
So on the last price column from 0 to 4000 then add the market cap column from 0 to pretty high here
and in the IPO Yeah column from nineteen hundred seventy to 2020.
And we can create these plots here by using the plot method and passing through to these subplots pair
meta and for each and every subplot we have a separate sexes and therefore we pass also falls through
these share X parameter and the default parameter for share Y is also false.
So this is I got here and we determined to have a fixed size of 15 15 and we create a let's add.
And finally we shouldn't forget to call P T data show.
So let's have a look here.
And uh the seer looks pretty good actually.
Next we have to create a histogram for the last price column with 200 pins and we only have to select
the listings with the last price smaller than 200.
So that's the graph that we should create here and therefore we filled our listings data frame and to
select only rows where the last price is smaller than 200.
Then we can you see the highest method to create a histogram and we pass that 200 to the pins parameter.
And finally we can also create a tighter last price frequency to see Putin then a label for the x axis
price a label for the y axis frequency.
And finally of course we call purity that so and that looks pretty good here.
Now we the next exercise you have to create a scatter plot with the last price on the sexes market cap
on the y axis and the IPO year is color.
So let's have a look here at our code and again we use the plot method and we pass the scatter for scatter
plot to the kind parameter and we pass the column last price to the expire meter end market cap to the
White perimeter.
And finally we pass the IPO year column to the color power meter.
And finally we also add a title and labels for the X and the y axis.
So this is that the graph here
and next.
We will create some seaborne plots and therefore first of all we import seaborne S S and S so that s
the convention here
and then first of all we create a counter plot and it should show the number or the count of listings
per exchange per IPO year starting from 2001.
So that's the graph here.
And first of all we can set a figure size that with a pure dealer figure.
And uh then we can create a count plot.
This uh seaborne dot com plot and we pass our listing stellar frame.
And actually here we have a field at Virgin so we filled our listings data frame only for listings with
IPO year later than 2000 and then we pass the IPO year to the x axis.
So here we are on the x axis that we have the IPO year and for each and every IPO year we differentiate
between the exchanges.
So yeah area for each and every year the number of IPOs for Nasdaq and New York Stock Exchange and Amex
and we can split this up by passing the Exchange column to the Hugh perimeter.
So let's run the sell here
next we have to create the following plot.
And this is a bomb plot and we should answer the question whether the lower market cap of stocks being
Amex listed as statistically insignificant.
So this is a seaborne bomb plot.
And then we pass our listings data frame to the data parameter and on the exact source here we have
the exchanges.
And on the y axis.
The market cap column.
So let's create the plot here
so here we are for the average market capitalizations.
For the listings on Nasdaq nicely and Amex and he and black you can see kind of a confidence interval.
And here we have the confidence interval for the Amex listings and the seems to be significant that
listings on the Amex have on average a lower market cap.
Here we shall impart the matrix 1.
See as we file and let's do this here.
Let's have a look so here we have a matrix with the IPO year index and these sectors as a column labels
so for example there are eight companies active in the capital goods sector that had the IPO in the
year nineteen hundred ninety three.
So that's the Matrix the data frame here and now we have to create the following seaborne heat map by
passing the matrix one data frame to the heat map method so we have as a net start heat map then you
pass matrix 1 and as a color map we use we this and the v Max is 25.
So let's have a look here
and here we can see on the right hand side the color scale from 0 IPO is to 25 IPOs.
So a yellow color marks the hot sectors.
And for example in the U.S. The 230 into 218 we have more than 25 IPOs in the healthcare sector and
also quite a lot in the finance sector and in the consumer services sector and also in the tech sector.
So that's actually the hot sectors in the most recent years.
All right.
And with this we are finished here and I hope to see also in the next exercise by.